Slave device and communication setting method

ABSTRACT

A digital camera capable of communicating with an external device through a predetermined communication bus and having a plurality of communication modes of diverse kinds includes a system control section and a USB control section which serve respectively as a judging device for transmitting a notification code for notifying a presently set-up communication mode, and then judging whether a command in response to the notification code is received from the master device within a predetermined time or not; and a communication controlling device for performing control on the basis of a judgment result of the judging device in such a manner that when a command in response to the notification code is received from a master device within the predetermined time, a state permitting communication with the master device is established in correspondence to the command, and when the command is not received within the predetermined time, connection to the master device is electrically released temporarily and then the connection is restored.

TECHNICAL FIELD

The present invention relates to a slave apparatus, a communicationsetting method, and the like applicable to a digital camera or the like,capable of performing USB connection in a mass storage class and animaging class.

BACKGROUND ART

FIG. 7 shows the configuration of an image data transfer systemcomprising a digital camera and external devices according to the priorart (see JP-A-2002-271721).

The image data transfer system 700 comprises a digital camera 710, aswell as a personal computer 720, a printer A 730, and a printer B 740serving as external devices. The printer A 730 and the printer B 740have a processing capability of acquiring image data from the digitalcamera 710 and then printing the image. In the image data transfersystem 700, each of the digital camera 710, the personal computer 720,the printer A 730, and the printer B 740 has an interface which supportsa USB (universal serial bus). The digital camera 710 is USB-connected tothe external devices respectively through USB cables 750 a-750 c.

As for the external devices connected to the digital camera 710, theprinter A 730 or the printer B 740 can acquire and directly print outimage data which has been image-acquired and recorded in the inside ofthe digital camera 710. The personal computer 720 can delete the imagedata stored in the digital camera 710. As such, various kinds ofprocessing for the image data stored in the digital camera 710 can beperformed under the control of the external devices.

Meanwhile, devices capable of USB connection can have a plurality ofcommunication modes. When communication partners have the samecommunication mode, their communication is achieved so that datatransfer or the like can be performed.

In the image data transfer system 700, the printer A 730 is amass-storage class supporting device which recognizes the digital camera710 as a mass storage device, and has a communication mode correspondingto the mass storage class. The printer B 740 is an imaging classsupporting device which recognizes the digital camera as an imagingdevice, and has a communication mode corresponding to the imaging class.The personal computer 720 has communication modes corresponding to bothclasses described above. The personal computer 720 can recognize thedigital camera as a mass storage device as well as an imaging class, andhas two communication modes corresponding to the mass storage class andthe imaging class.

These external devices try to perform communication necessary for imagedata transfer, on the assumption that a device serving as the partner inthe USB connection has the same communication mode as their owncommunication mode. Nevertheless, communication is not achieved when thepartner device does not have the same communication mode.

In the use of such external devices, a user of the digital camera 710selects in advance any communication mode from the group consisting ofthe mass storage class and the imaging class in correspondence to theclass of an external device to be connected, so that the set up isachieved such that the communication mode becomes the same as that ofthe external device.

This allows the digital camera to support external devices in both casesthat an external device like the printer A 730 recognizes the digitalcamera as a mass storage device and that an external device recognizesthe digital camera as an imaging device although not shown in thefigure. This allows the digital camera 710 to be connected to variousexternal devices.

Nevertheless, in order to select a communication mode, the user needs tounderstand the communication modes in both of the external device andthe digital camera 710, and find what kind of a communication mode isused in the present system, so as to select and set an appropriatecommunication mode of the digital camera 710. This has been a notablyannoying work for users, and has caused inconvenience especially tousers unfamiliar with the operation of the digital camera 710.

DISCLOSURE OF THE INVENTION

The present invention has been devised with considering theabove-mentioned problems. A purpose of the present invention is toprovide a slave apparatus and the like applicable to a digital camera orthe like, and capable of setting up the communication mode automaticallyin correspondence to the type of an external device to be connected,without a user's complicated operation.

A first present invention is a slave apparatus capable of communicatingwith a master device through a predetermined communication bus andhaving a plurality of communication modes of diverse kinds, said slaveapparatus comprising:

judging means of transmitting to said master device a notification codeof notifying a presently set-up own communication mode, and then judgingwhether a command in response to said notification code is received fromsaid master device within a predetermined time or not; and

communication controlling means of performing control on the basis of ajudgment result of said judging means in such a manner that when acommand in response to said notification code is received from saidmaster device within the predetermined time, a state permittingcommunication with said master device is established in correspondenceto the command, and that when said command is not received within saidpredetermined time, connection to said master device is electricallyreleased temporarily and then said connection is restored; wherein

by the time when said slave apparatus and said master device resumecommunication as a result of said restoration of connection, saidcommunication controlling means selects one from a plurality of saidcommunication modes so that its own communication mode is changed intoone different from that used immediately before said release.

A second present invention is a slave apparatus capable of communicatingwith a master device through a predetermined communication bus andhaving a plurality of communication modes of diverse kinds, said slaveapparatus comprising:

judging means of transmitting to said master device a notification codeof notifying a presently set-up own communication mode, and then judgingwhether a command received from said master device in response to saidnotification code corresponds to said presently set-up own communicationmode or not; and

communication controlling means of performing control on the basis of ajudgment result of said judging means in such a manner that when saidcommand corresponds to the presently set-up communication mode, a statepermitting communication with said master device is established incorrespondence to the command, and that when said command does notcorrespond to the presently set-up communication mode, connection tosaid master device is electrically released temporarily and then saidconnection is restored; wherein

by the time when said slave apparatus and said master device resumecommunication as a result of said restoration of connection, saidcommunication controlling means selects one from a plurality of saidcommunication modes so that its own communication mode is changed intoone different from that used immediately before said release.

A third present invention is a slave apparatus capable of communicatingwith a master device through a predetermined communication bus andhaving a plurality of communication modes of diverse kinds, said slaveapparatus comprising:

communication mode identifying means of transmitting to said masterdevice a notification code of notifying a presently set-up owncommunication mode, and then identifying the kind of communication modecorresponding to a command received from said master device in responseto said notification code; and

communication controlling means of performing control such as to changeits own communication mode in correspondence to an identification resultof said communication mode identifying means and then establish a statepermitting communication with said master device.

A fourth present invention is the slave apparatus according to any oneof the first to the third present inventions, wherein said predeterminedcommunication bus is a USB (universal serial bus) type.

A fifth present invention is the slave apparatus according to the fourthpresent invention, wherein said communication controlling means performssaid release by pulling up or pulling down a voltage applied to a D⁺ ora D⁻ line of said USB.

A sixth present invention is the slave apparatus according to the fourthpresent invention, wherein said communication controlling means performssaid release by turning OFF a V_(BUS) line through which a voltage fromsaid host device is supplied in said USB.

A seventh present invention is the slave apparatus according to any oneof the first to the third present inventions, wherein a plurality ofsaid communication modes include at least two modes selected from a modecorresponding to an imaging class, a mode corresponding to a massstorage class, a mode corresponding to a customized class, and a modecorresponding to a streaming class.

An eighth present invention is the slave apparatus according to theseventh present invention, wherein said mode corresponding to a massstorage class among a plurality of said communication modes is set up initself as an initial state.

A ninth present invention is the slave apparatus according to the fourthpresent invention, wherein said USB is embodied as a wire USB cable.

A tenth present invention is the slave apparatus according to the fourthpresent invention, wherein said USB is embodied as a wireless circuit.

An eleventh present invention is the slave apparatus according to anyone of the first to the third present inventions, comprising displayingmeans of displaying information on a communication state includinginformation concerning a communication mode presently set up in itself.

A twelfth present invention is the digital camera comprising a slaveapparatus according to any one of the first to the third presentinventions and

capable of transmitting recorded-by-oneself data recorded by itself tosaid master device through said communication.

A thirteenth present invention is a communication setting method ofsetting a communication mode in a slave device capable of communicatingwith a master device through a predetermined communication bus andhaving a plurality of communication modes of diverse kinds, said methodcomprising:

a judging step of transmitting to said master device a notification codeof notifying a communication mode presently set up in said slave device,and then judging whether a command in response to said notification codeis received from said master device within a predetermined time or not;and

a communication controlling step of performing control on the basis of ajudgment result of said judging step in such a manner that when acommand in response to said notification code is received from saidmaster device within the predetermined time, said slave device is setinto a state permitting communication with said master device incorrespondence to the command, and that when said command is notreceived within said predetermined time, said slave device electricallyreleases connection to said master device temporarily and then restoressaid connection; wherein

in said communication controlling step, by the time when said slavedevice and said master device resume communication as a result of saidrestoration of connection, a communication mode is selected from aplurality of said communication modes so that its own communication modeis changed into one different from that used immediately before saidrelease.

A fourteenth present invention is a communication setting method ofsetting a communication mode in a slave apparatus capable ofcommunicating with a master device through a predetermined communicationbus and having a plurality of communication modes of diverse kinds, saidmethod comprising:

a judging step of transmitting to said master device a notification codeof notifying a communication mode presently setup in said slaveapparatus, and then judging whether a command received from said masterdevice in response to said notification code corresponds to saidcommunication mode presently set up in said slave apparatus or not; and

a communication controlling step of performing control on the basis of ajudgment result of said judging step in such a manner that when saidcommand corresponds to the communication mode presently set up in saidslave apparatus, a state permitting communication between said slaveapparatus and said master device is established in correspondence to thecommand, and that when said command does not correspond to thecommunication mode presently set up in said slave apparatus, said slaveapparatus electrically releases connection to said master devicetemporarily and then restores said connection; wherein

in said communication controlling step, by the time when said slaveapparatus and said master device resume communication as a result ofsaid restoration of connection, a communication mode is selected from aplurality of said communication modes so that its own communication modeis changed into one different from that used immediately before saidrelease.

A fifteenth present invention is a communication setting method ofsetting a communication mode in a slave apparatus capable ofcommunicating with a master device through a predetermined communicationbus and having a plurality of communication modes of diverse kinds, saidmethod comprising:

a communication mode identifying step of transmitting to said masterdevice a notification code of notifying a communication mode presentlyset up in said slave apparatus, and then identifying the kind ofcommunication mode corresponding to a command received from said masterdevice in response to said notification code; and

a communication controlling step of performing control such as to changethe communication mode of said slave apparatus in correspondence to anidentification result of said communication mode identifying step andthen establish a state permitting communication with said master device.

A sixteenth present invention is a program of causing a computer toserve, in a slave apparatus according to the first present invention,as: judging means of transmitting to said master device a notificationcode of notifying a presently set-up own communication mode, and thenjudging whether a command in response to said notification code isreceived from said master device within a predetermined time or not; andcommunication controlling means of performing control on the basis of ajudgment result of said judging means in such a manner that when acommand in response to said notification code is received from saidmaster device within the predetermined time, a state permittingcommunication with said master device is established in correspondenceto the command, and that when said command is not received within saidpredetermined time, connection to said master device is electricallyreleased temporarily and then said connection is restored.

A seventeenth present invention is a program of causing a computer toserve, in a slave apparatus according to the second present invention,as: judging means of transmitting to said master device a notificationcode of notifying a presently set-up own communication mode, and thenjudging whether a command received from said master device in responseto said notification code corresponds to said presently set-up owncommunication mode or not; and communication controlling means ofperforming control on the basis of a judgment result of said judgingmeans in such a manner that when said command corresponds to thepresently set-up communication mode, a state permitting communicationwith said master device is established in correspondence to the command,and that when said command does not correspond to the presently set-upcommunication mode, connection to said master device is electricallyreleased temporarily and then said connection is restored.

An eighteenth present invention is a program of causing a computer toserve, in a slave apparatus according to the third present invention,as: communication mode identifying means of transmitting to said masterdevice a notification code of notifying a presently set-up owncommunication mode, and then identifying the kind of communication modecorresponding to a command received from said master device in responseto said notification code; and communication controlling means ofperforming control such as to change its own communication mode incorrespondence to an identification result of said communication modeidentifying means and then establish a state permitting communicationwith said master device.

A nineteenth present invention is a computer-processable recordingmedium carrying a program according to any one of the sixteenth to thenineteenth present inventions.

A twelfth present invention is an information processing apparatuscomprising a slave apparatus according to any one of the first to thethird present inventions and capable of communicating with said masterdevice.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a configuration diagram of an image transfer system comprisinga digital camera 110 and external devices according to Embodiment 1 ofthe present invention.

FIG. 2 is a block diagram showing the configuration of a digital camera110 and its vicinity according to Embodiment 1 of the present invention.

FIG. 3 is a block diagram showing a rear view of a digital camera 110according to Embodiment 1 of the present invention.

FIG. 4 is a diagram showing a flow chart of operation of a digitalcamera 110 according to Embodiment 1 of the present invention.

FIG. 5(a) is a schematic operation diagram of a liquid crystal displaymonitor 114 of a digital camera 110 according to Embodiment 1 of thepresent invention.

FIG. 5(b) is a schematic operation diagram of a liquid crystal displaymonitor 114 of a digital camera 110 according to Embodiment 1 of thepresent invention.

FIG. 5(c) is a schematic operation diagram of a liquid crystal displaymonitor 114 of a digital camera 110 according to Embodiment 1 of thepresent invention.

FIG. 5(d) is a schematic operation diagram of a liquid crystal displaymonitor 114 of a digital camera 110 according to Embodiment 1 of thepresent invention.

FIG. 5(e) is a schematic operation diagram of a liquid crystal displaymonitor 114 of a digital camera 110 according to Embodiment 1 of thepresent invention.

FIG. 6 is a diagram showing a flow chart of operation of a digitalcamera 110 according to Embodiment 2 of the present invention.

FIG. 7 is a configuration diagram of an image transfer system comprisinga digital camera 110 and external devices according to the prior art.

FIG. 8 is a diagram showing a flow chart of operation of a digitalcamera 110 according to Embodiment 1 of the present invention.

FIG. 9 is a diagram showing a flow chart of operation of a digitalcamera 110 according to Embodiment 1 of the present invention.

DESCRIPTION OF REFERENCE NUMERALS

-   110 Digital camera-   111 Imaging means-   112 Image processing means-   113 Memory card-   114 Liquid crystal display monitor-   115 System controlling means-   116 Operating means-   117 Communication connector-   118 USB control section-   200 USB cable-   210 V_(BUS) line-   220 D⁺ line-   230 D⁻ Line-   240 GND line-   300 External device

BEST MODE FOR CARRYING OUT THE INVENTION

Embodiments of the present invention are described below with referenceto the drawings.

EMBODIMENT 1

FIG. 1 is a configuration diagram of an image data transfer systemcomprising a digital camera and external devices according to Embodiment1 of the present invention.

In the image data transfer system 100, the configuration other than adigital camera 110 is the same as the prior art example. That is, aprinter A 730 and a printer B 740 serving as external devices have aprocessing capability of acquiring image data from the digital camera110 and then printing the image. In the image data transfer system 100,each of the digital camera 110, the personal computer 720, the printer A730, and the printer B 740 has an interface which supports USB(universal serial bus). The digital camera 110 is USB-connected to theexternal devices respectively through USB cables 750 a-750 c.

Similarly to the prior art example, the printer A 730 is a mass-storageclass supporting device which recognizes the digital camera 110 as amass storage device, and has a communication mode corresponding to themass storage class. The printer B 740 is an imaging class supportingdevice which recognizes the digital camera as an imaging device, and hasa communication mode corresponding to the imaging class. The personalcomputer 720 has communication modes corresponding to both classesdescribed above. The personal computer 720 can recognize the digitalcamera as an imaging class as well as a mass storage device, and has twocommunication modes corresponding to the mass storage class and theimaging class.

Next, FIG. 2 is a block diagram showing the configuration of a digitalcamera 110 and its vicinity according to Embodiment 1 of the presentinvention. As shown in FIG. 2, in the digital camera 110, imaging means111 is means of imaging an object and thereby acquiring image data.Image processing means 112 is means of processing the image dataacquired by the imaging means 111, into data capable of being displayedand stored. A memory card 113 is means of storing the image data. Aliquid crystal display monitor 114 is means of displaying the contentsof the acquired image data as well as the operation and function of thedigital camera 110. System controlling means 115 is means of controllingthe image processing means 112, and operates on the basis of an inputfrom operating means 116 of receiving a user operation.

A communication connector 117 is a connector of connecting a USB cable200. A USB control section 118 is means of controlling the connectionstate and the communication through the USB cable, and is controlled bythe system controlling means 115. In practice, the USB control section118 is embodied in a dedicated semiconductor chip or the like.

The USB cable 200 corresponds to the USB cables 750 a-750 c of FIG. 1,and is connected to an external device 300 corresponding to the personalcomputer 720, the printer A 730, and the printer B 740 of FIG. 1. TheUSB cable 200 comprises four signal lines which consists of: a V_(BUS)line 210 through which a voltage is supplied from the external device300; a D⁺ line 220 and a D⁻ line 230 through which data is transferredbetween the external device 300 and the digital camera 110; and a GNDline 240 through which a reference potential is provided. Asschematically shown in FIG. 2, the USB control section 118 can controlthe connection of each of the four lines constituting the USB cable 200.

Next, FIG. 3 is a block diagram showing a rear view of a digital camera110 according to Embodiment 1 of the present invention. As shown in FIG.3, when a power switch 116 a serving as a part of the operating means116 is turned to an arrow A side in the figure, the power supply of thedigital camera 110 goes ON. When the switch is turned to an arrow Bside, the power supply of the digital camera goes OFF. The operatingmeans 116 further comprises: a shutter button 116 b; a decision button116 c; a cursor key 116 d of operating in the four directions of U (up),R (right), L (left), and D (down); and a menu button 116 e for menuselection. In addition, the rear surface is provided with: a liquidcrystal display monitor 114 exposed therein; and a finder 119 usedduring image acquisition. However, portions concerning the imagingfunction of the digital camera 110 are the same as those of known art,and hence their detailed description is omitted.

In the above-mentioned configuration, the digital camera 110 correspondsto a device carrying a slave device of the present invention. Theexternal device 300 (the personal computer 720, the printer A 730, orthe printer B 740) corresponds to a master apparatus of the presentinvention. The system controlling means 115 and the USB control section118 correspond to judging means and communication controlling means ofthe present invention. The liquid crystal display monitor 114corresponds to displaying means of the present invention.

The operation of the digital camera 110 according to Embodiment 1 of thepresent invention having the above configuration is described below withreference to the flow chart of FIG. 4 as well as the schematic operationdiagram of FIG. 5 for a liquid crystal display monitor 114. At the sametime, described is an embodiment of a communication setting method ofthe present invention.

(1) First, the operation is described below for the case that thedigital camera 110 is connected to the personal computer 720 or theprinter A 730 serving as an external device 300 of mass storage class.

A user selects an automatic mode using the cursor key 116 d, the menubutton 116 e, and the decision button 116 c with reference to aselection screen on the liquid crystal display monitor 114 shown in FIG.5(a) (S1). Then, the user physically connects the digital camera 110 tothe communication connector of the personal computer 720 or the printerA 730 through the USB cable 200.

Once the connection is established through the USB cable 200,negotiation starts for performing communication in the mass storageclass between the digital camera 110 and the external device 300 (inthis case, the personal computer 720 or the printer A 730) (S2).Specifically, the USB control section 118 pulls up the voltage of the D⁺line in the USB cable shown in FIG. 2, so as to electrically connect thedigital camera 110 to the external device 300.

Then, the external device 300 transmits to the digital camera 110 acommand (standard request) for starting negotiation. In response to thestandard request, the digital camera 110 transmits to the externaldevice 300 a notification code of notifying that oneself (the digitalcamera 110) is amass storage device (S3).

In response to the notification code, the external device 300 transmitsa command of mass storage class. The digital camera 110 receives thiscommand (Yes in S4), and then continues the communication in the massstorage class (S10). At that time, on the basis of the control of theUSB control section 118, the system controlling means 115 displays ascreen shown in FIG. 5(c) onto the liquid crystal display monitor 114,and thereby notifies the user of the communication state of the digitalcamera 110. After that, once the communication is established betweenthe digital camera 110 and the personal computer 720 or the printer A730, the personal computer 720 or the printer A 730 can process imagedata in the memory card 113 in the digital camera 110.

(2) Next, the operation is described below for the case that the digitalcamera 110 is connected to the printer B 740 serving as an externaldevice 300 of imaging class.

Similarly to case (1), the digital camera 110 and the printer B 740 areconnected through the USB cable 200. Then, an automatic mode is selectedon the selection screen shown in FIG. 5(a) (S1). As a result,negotiation starts for performing communication in the mass storageclass with the printer B 740 (S2)

Then, the printer B 740 transmits to the digital camera 110 a command(standard request) for starting negotiation. In response to the standardrequest, the digital camera 110 transmits to the printer B 740 acommunication code of notifying that oneself (the digital camera 110) isa mass storage device (S3).

Nevertheless, the printer B 740 is a device of imaging class. Thus, (a)even when receiving the communication code from the digital camera 110serving as a device of mass storage class, the printer cannotdistinguish the code and hence cannot transmit a corresponding command.Otherwise, depending on the type of the printer B 740, (b) the printertransmits a command of imaging class regardless of the kind of thecommunication code from the digital camera 110.

Neither case (a) nor (b) described above can the digital camera 110receive any command of mass storage class corresponding to its owncommunication mode (No in S4).

At that time, the digital camera 110 terminates the communication in themass storage class. Specifically, in case (a), when confirming that nocommand is received after a predetermined time duration, the USB controlsection 118 pulls down the voltage of the D⁺ line 220 in the USB cableshown in FIG. 2, and thereby temporarily releases the electricconnection between the digital camera 110 and the external device 300 soas to terminate the communication in the mass storage class (S5). Thistime duration may be measured by a dedicated timer provided in theconfiguration although not shown in the figure. Alternatively, a clockin the system controlling means 115 of the digital camera 110 may beused. The predetermined time duration is preferably set to be at least 5seconds or the like.

In case (b) described above, after the USB control section 118 receivesthe command of imaging class from the printer B 740 and confirms thatthe command is not of mass storage class, the USB control section pullsdown the voltage of the D⁺ line in the USB cable shown in FIG. 2, andthereby temporarily releases the electric connection between the digitalcamera 110 and the external device 300 so as to terminate thecommunication in the mass storage class (S5).

This confirmation is carried out by referring to a packet of the commandin each class. More specifically, a configuration such as a packet sizeand a head part is referred to. For example, a packet of mass storageclass (in the case of Bulk-Only Transfer) has a size of 31 bytes, andhas an identifier “USBC” in the head part. Thus, the USB control section118 checks the presence or absence of this identification information.In contrast, a packet of imaging class (in the case of PTP: PictureTransfer Protocol) has a variable size, while its head part storespacket size information.

Then, in the digital camera 110, the USB control section 118 pulls upagain the voltage of the D⁺ line 220 in the USB cable 200, and therebyresumes the negotiation (S6).

The negotiation in S6 is the same as the negotiation operation in stepS2. However, as a part of the negotiation, the USB control section 118of the digital camera 110 switches the communication mode, and thentransmits to the printer B 740 a new communication code of notifyingthat the digital camera 110 itself is an imaging device (S7). At thattime, the switching of the communication mode is sufficient as long asthe switching is carried out after the electric connection istemporarily released between the digital camera 110 and the externaldevice 300 and before the transmission of a new communication code isstarted. That is, the switching may be carried out before the USBcontrol section 118 pulls up again the voltage of the D⁺ line in the USBcable 200, or alternatively immediately after the pull-up. However, inorder to ensure the communication, the switching of the communicationmode is preferably completed before the pull-up.

Then, in response to this new communication code, the printer B 740transmits a command of imaging class. The digital camera 110 receivesthis command (Yes in S8), and then continues the communication in theimaging class (S9). At that time, the digital camera displays a screenshown in FIG. 5(d) onto the liquid crystal display monitor 114, andthereby notifies the user of the communication state of the digitalcamera 110. After that, once the communication is established betweenthe digital camera 110 and the printer B 740, the printer B 740 canprocess image data in the memory card 113 in the digital camera 110.

The judgment whether the command has been received or not in S8 iscarried out by measuring a predetermined time duration similarly to thecase of S4. When a command of imaging class is received, the procedureautomatically goes to S9 so that a state of communication continuationis established. When no command is received, a screen shown in FIG. 5(e)is displayed on the liquid crystal display monitor 114 so as to notifythe user that communication is not established between the devices(S11). Such a situation can occur when the USB cable 200 is notappropriately inserted into the communication connector 117 or the likeso that physical connection is not secured.

As such, according to a digital camera of the present embodiment, evenin case that external devices have communication modes corresponding totwo different classes, the digital camera automatically selects anappropriate communication mode, and thereby establishes a communicationstate. This avoids a user's complicated operation.

In the above-mentioned description, the connection has been electricallyreleased by pulling up and pulling down the voltage applied to the D⁺line 220 of the USB cable 200. Alternatively, the release may be carriedout by pulling up and pulling down the voltage applied to the D⁻ line230 of the USB cable 200. Further, the release may be carried out byON-OFF switching the supply of a voltage through the V_(BUS) line 210 ofthe USB cable 200. Each of these operations is equivalent to physicaldisconnection of the USB cable 200, and hence ensures the resetoperation by the external device 300.

Further, in the above-mentioned description, in the automatic mode, acommunication code of notifying that the device is of mass storage classhas been transmitted first (S3), and a communication code of notifyingthat the device is of imaging class has been transmitted later (S7).These communication codes may be in reverse order. However, withconsidering the following reasons, the order used in the above-mentionedembodiment is preferred. That is, a majority of personal computers inthe market support the mass storage class, while for the purpose of thestorage or the like of image data, a special connection is made to apersonal connection. Further, depending on the type of an externaldevice 300, for example, in a part of personal computers, when a deviceof imaging class is connected, subsequent processing is suspended untila suitable driver is found. These are the reasons.

In the above-mentioned description, two kinds of communication modes,that is, the communication mode of mass storage class and thecommunication mode of imaging class have been used. However, thecommunication modes may be three or more. For example, communicationmodes may also be included that correspond to a customized class and astreaming class. Namely, it is sufficient that at least two kinds ofcommunication modes are included that are selected from theabove-mentioned communication modes.

When three or more communication modes are included as described above,the above-mentioned switching of the communication mode from S5 to S6 iscarried out such that the digital camera 110 should select a newcommunication mode different from the communication mode having been setup by the digital camera itself in S1-S4 from among the communicationmodes provided in the digital camera. The flow charts of FIGS. 8 and 9show an example where the external device 300 serves as three deviceseach having any of communication modes of three kinds of classesconsisting of the mass storage class, the imaging class, and thecustomized class, while the digital camera 110 also supports these threecommunication modes. However, in FIGS. 8 and 9, like steps to FIG. 4 aredesignated by like numerals, and detailed description of these steps isomitted.

In FIGS. 8 and 9, in case that the external device 300 is a device ofmass storage class, communication is established in the flow of S1-S4and S10. In the case that the external device 300 is a device of imagingclass, communication is established in the flow of S1-S9. These flowsare the same as the corresponding steps of FIG. 4.

On the other hand, in case that the external device 300 is a device ofcustomized class, the digital camera 110 cannot receive a command ofimaging class in S8 of FIG. 9, because of the same reasons as (a) and(b) described in S4 of FIG. 4. Thus, the USB control section 118 pullsdown the voltage of the D⁺ line in the USB cable shown in FIG. 2, andthereby temporarily releases the electric connection between the digitalcamera 110 and the external device 300 so as to terminate thecommunication in the imaging class (S31).

Then, the USB control section 118 pulls up again the voltage of the D⁺line 220 in the USB cable 200, and thereby resumes the negotiation(S32). At that time, the USB control section switches the communicationmode in the same timing as S5-S6 described above, and then transmits tothe external device 300 a new communication code of notifying that thedigital camera 110 itself is a device of customized class (S33).

Then, in response to this new communication code, the external device300 transmits a command of customized class. The digital camera 110receives this command (Yes in S34), and then continues the communicationin the customized class (S35) When no command can received, the user isnotified through the liquid crystal display monitor that communicationcan not be established between the devices (S11). Such a situation canoccur when the USB cable 200 is not appropriately inserted into thecommunication connector 117 or the like so that physical connection isnot secured. Alternatively, it is also possible that the external device300 is a device of a class of communication mode different from theabove-mentioned three communication modes.

In case that the digital camera 110 has a communication mode of theclass other than the above-mentioned three classes, after terminatingthe communication of customized class, the digital camera resumes thecommunication in the communication mode so as to try to establishcommunication. The communication is established when the external device300 is a device of the tried class. Otherwise, an error message isdisplayed finally.

In the above-mentioned operation, between S2 and S10, S9, or S11, thedigital camera 110 may be in a state that no user operation is acceptedregardless of the user's attempt. In this duration, a screen shown inFIG. 5(b) is displayed on the liquid crystal display monitor 114 so asto notify the user that a connection process is on-going.

EMBODIMENT 2

Described below is the operation of a digital camera according toEmbodiment 2 of the present invention. The configuration is the same asthat of Embodiment 1. Thus, description is given with reference to FIGS.1-2, while detailed description is omitted for like parts to Embodiment1.

A digital camera of the present embodiment differs from that ofEmbodiment 1 in the point that the USB control section 118 candistinguish the kind of the communication mode of the external device300 connected through the USB cable 200. The system controlling means115 and the USB control section 118 correspond to communication modeidentifying means and communication controlling means respectively ofthe present invention.

Description is given below with reference to the flow chart of FIG. 6.

A user physically connects the digital camera 110 and the externaldevice 300 through the USB cable 200 connected between theircommunication connectors. Then, referring to the selection screen on theliquid crystal display monitor 114 shown in FIG. 5(a), the user selectsan automatic mode (S21).

Once the automatic mode is selected, negotiation for performingcommunication in the mass storage class starts between the digitalcamera 110 and the external device 300 (S22). Specifically, the USBcontrol section 118 pulls up the voltage of the D⁺ line in the USB cableshown in FIG. 2, so as to electrically connect the digital camera 110 tothe external device 300.

Then, the external device 300 transmits to the digital camera 110 acommand (standard request) for starting negotiation. The digital camera110 transmits a notification code of notifying that the digital camera110 itself is a mass storage device in response to the standard request(S23).

In response to this notification code, the external device 300 transmitsa command of mass storage class when the external device 300 is a deviceof mass storage class like the personal computer 720 or the printer A730. When the external device is a device of imaging class like theprinter B 740, the external device transmits a command of imaging class.The digital camera 110 receives such a command.

In the digital camera 110, the USB control section 118 judges whetherthe presently received command is of the communication mode of massstorage class or of the communication mode of imaging class (S24).Similarly to the operation of checking the command in Embodiment 1, thejudgment is carried out by referring to a packet of the command in eachclass. More specifically, a configuration such as a packet size and ahead part is referred to. For example, a packet of mass storage class(in the case of Bulk-Only Transfer) has a size of 31 bytes, and has anidentifier “USBC” in the head part. In contrast, a packet of imagingclass (in the case of PTP: Picture Transfer Protocol) has a variablesize, while its head part stores packet size information.

When the command is of mass storage class, the USB control section 118continues the communication intact (S25). When the command is of imagingclass, the USB control section changes its self-set communication modeinto that of imaging class, and continues the communication (S26) so asto establish communication between the digital camera 110 and theexternal devices 300.

Thus, according to the present embodiment, the communication mode of theexternal device 300 can be distinguished immediately, so thatcommunication can be established.

In the above-mentioned description, the external device 300 has beencapable of transmitting a command of imaging class regardless of thekind of the communication code from the digital camera 110. However, incase that the external device is a device of a kind not capable oftransmitting a corresponding command, it is sufficient to switch thecommunication mode automatically after a predetermined time durationsimilarly to Embodiment 1.

In the configuration of each embodiment described above, the connectionbetween the digital camera 110 and the external device 300 has beenestablished through the wire USB cable 200. However, the presentinvention is not limited to this. For example, the configurations mayemploy wireless communication (such as a wireless USB). Further, atelecommunication standard other than the USB may be used as long as ithas a plurality of communication modes.

In each embodiment described above, a slave device of the presentinvention has been built in a digital camera. However, the slave deviceof the present invention may be embodied as an information processingdevice of the present invention built in another apparatus capable ofcommunicating with a host device. Such an information processing devicemay be a removable-media carrying device such as a PDA, a portablephone, a hand-held computer, an external hard disk drive, a hard diskrecorder, and a DVD recorder.

A program according to the present invention may be a program whichcauses a computer to perform the function of all or a part of the means(or apparatuses, elements, circuits, sections, or the like) of the slavedevice of the present invention described above, and which cooperateswith the computer.

The present invention may be a medium which carries a program of causinga computer to perform the function of all or a part of the means of theslave device of the present invention described above and which can beread out by a computer, wherein said read-out program cooperates withsaid computer so as to perform said function.

The above-mentioned phrase “a part of the means” of the presentinvention indicates: a piece or pieces of means among plural pieces ofthe means; or a part of functions of a piece of means.

A part of the apparatuses of the present invention indicates: anapparatus or apparatuses among a plurality of the apparatuses; a part ofmeans of an apparatus; or a part of functions of a piece of means.

A computer-readable recording medium carrying a program of the presentinvention is also included within the scope of the present invention.

A manner of usage of a program of the present invention may be that theprogram is recorded on a computer-readable recording medium andcooperates with a computer.

A manner of usage of a program of the present invention may be that theprogram is transmitted inside a transmission media, read out by acomputer, and cooperates with the computer.

Data structures according to the present invention include a database, adata format, a data table, a data list, and the kind of data.

Recording media include a ROM. Transmission media include a transmissionmechanism such as the Internet, as well as light, radio waves, andacoustic waves.

A computer of the present invention described above is not limited togenuine hardware such as a CPU, and may be firmware, an OS, and aperipheral device.

As described above, the configuration of the present invention may beembodied by software or hardware.

INDUSTRIAL APPLICABILITY

As such, the present invention provides a slave apparatus, acommunication setting method, and the like applicable to a digitalcamera or the like and capable of setting up the communication modeautomatically in correspondence to the type of an external device to beconnected.

1. A slave apparatus capable of communicating with a master devicethrough a predetermined communication bus and having a plurality ofcommunication modes of diverse kinds, said slave apparatus comprising:judging means of transmitting to said master device a notification codeof notifying a presently set-up communication mode, and then judgingwhether a command in response to said notification code is received fromsaid master device within a predetermined time or not; and communicationcontrolling means of performing control on the basis of a judgmentresult of said judging means in such a manner that when a command inresponse to said notification code is received from said master devicewithin the predetermined time, a state permitting communication withsaid master device is established in correspondence to the command, andthat when said command is not received within said predetermined time,connection to said master device is electrically released temporarilyand then said connection is restored; wherein by the time when saidslave apparatus and said master device resume communication as a resultof said restoration of connection, said communication controlling meansselects one from a plurality of said communication modes so that its owncommunication mode is changed into one different from that usedimmediately before said release. 2.-14. (canceled)
 15. A slave apparatuscapable of communicating with a master device through a predeterminedcommunication bus and having a plurality of communication modes ofdiverse kinds, said slave apparatus comprising: judging means oftransmitting to said master device a notification code of notifying apresently set-up communication mode, and then judging whether a commandreceived from said master device in response to said notification codecorresponds to said presently set-up own communication mode or not; andcommunication controlling means of performing control on the basis of ajudgment result of said judging means in such a manner that when saidcommand corresponds to the presently set-up communication mode, a statepermitting communication with said master device is established incorrespondence to the command, and that when said command does notcorrespond to the presently set-up communication mode, connection tosaid master device is electrically released temporarily and then saidconnection is restored; wherein by the time when said slave apparatusand said master device resume communication as a result of saidrestoration of connection, said communication controlling means selectsone from a plurality of said communication modes so that its owncommunication mode is changed into one different from that usedimmediately before said release.
 16. A slave apparatus capable ofcommunicating with a master device through a predetermined communicationbus and having a plurality of communication modes of diverse kinds, saidslave apparatus comprising: communication mode identifying means oftransmitting to said master device a notification code for notifying apresently set-up communication mode, and then identifying the kind ofcommunication mode corresponding to a command received from said masterdevice in response to said notification code; and communicationcontrolling means of performing control such as to change its owncommunication mode in correspondence to an identification result of saidcommunication mode identifying means and then establish a statepermitting communication with said master device.
 17. The slaveapparatus according to claims 1, 15 or 16, wherein said predeterminedcommunication bus is a universal serial bus (“USB”) type.
 18. The slaveapparatus according to claim 17, wherein said communication controllingmeans performs said release by pulling up or pulling down a voltageapplied to a D⁺ or a D⁻ line of said USB.
 19. The slave apparatusaccording to claim 17, wherein said communication controlling meansperforms said release by turning OFF a V_(bus) line through which avoltage from said hose device is supplied in said USB.
 20. The slaveapparatus according to claims 1, 15 or 16, wherein a plurality of saidcommunication modes include at least two modes selected from a modecorresponding to an imaging class, a mode corresponding to a massstorage class, a mode corresponding to a customized class, and a modecorresponding to a streaming class.
 21. The slave apparatus according toclaim 20, wherein said mode corresponding to a mass storage class amonga plurality of said communication modes is set up as an initial state.22. The slave apparatus according to claim 17, wherein said USB embodiedas a wire USB cable.
 23. The slave apparatus according to claim 17,wherein said USB is embodied as a wireless circuit.
 24. The slaveapparatus according to claims 1, 15 or 16, comprising displaying meansof displaying information on a communication state including informationconcerning a communication mode presently set up.
 25. A digital cameracomprising a slave apparatus according to claims 1, 15 or 16, andcapable of transmitting recorded-by-oneself data recorded by itself tosaid master device through said communication bus.
 26. A communicationsetting method of setting a communication mode in a slave device capableof communicating with a master device through a predeterminedcommunication bus and having a plurality of communication modes ofdiverse kinds, said method comprising: a judging step of transmitting tosaid master device a notification code for notifying a communicationmode presently set up in said slave device, and then judging whether acommand in response to said notification code is received from saidmaster device within a predetermined time or not; and a communicationcontrolling step of performing control on the basis of a judgment resultof said judging step in such a manner that when a command in response tosaid notification code is received from said master device within thepredetermined time, said slave device is set into a state permittingcommunication with said master device in correspondence to the command,and that when said command is not received within said predeterminedtime, said slave device electrically releases connection to said masterdevice temporarily and then restores said connection; wherein in saidcommunication controlling step, by the time when said slave device andsaid master device resume communication as a result of said restorationof connection, a communication mode is selected from a plurality of saidcommunication modes so that its own communication mode is changed intoone different from that used immediately before said release.
 27. Acommunication setting method of setting a communication mode in a slaveapparatus capable of communicating with a master device through apredetermined communication bus and having a plurality of communicationmodes of diverse kinds, said method comprising: a judging step oftransmitting to said master device a notification code for notifying acommunication mode presently set up in said salve apparatus, and thenjudging whether a command received from said master device in responseto said notification code corresponds to said communication modepresently set up in said slave apparatus or not; and a communicationcontrolling step of performing control on the basis of a judgment resultof said judging step in such a manner than when said command correspondsto the communication mode presently set in said slave apparatus, a statepermitting communication between said slave apparatus and said masterdevice is established in correspondence to the command, and that whensaid command does not correspond to the communication mode presently setup in said slave apparatus, said slave apparatus electrically releasesconnection to said master device temporarily and then restores saidconnection; wherein in said communication controlling step, by the timewhen said slave apparatus and said master device resume communication asa result of said restoration of connection, a communication mode isselected from a plurality of said communication modes so that its owncommunication mode is changed into one different from that usedimmediately before said release.
 28. A communication setting method ofsetting a communication mode in a slave apparatus capable ofcommunicating with a master device through a predetermined communicationbus and having a plurality of communication modes of diverse kinds, saidmethod comprising: a communication mode identifying step of transmittingto said master device a notification code for notifying a communicationmode presently set up in said slave apparatus, and then identifying thekind of communication mode corresponding to a command received from saidmaster device in response to said notification code; and a communicationcontrolling step of performing control such as to change thecommunication mode of said slave apparatus in correspondence to anidentification result of said communication mode identifying step andthen establish a state permitting communication with said master device.29. A program causing a computer to serve, in a slave apparatusaccording to claim 1, as: judging means of transmitting to said masterdevice a notification code of notifying a presently set-up communicationmode, and then judging whether a command in response to saidnotification code is received from said master device within apredetermined time or not; and communication controlling means ofperforming control on the basis of a judgment result of said judgingmeans in such a manner that when a command in response to saidnotification code is received from said master device within thepredetermined time, a state permitting communication with said masterdevice is established in correspondence to the command, and that whensaid command is not received within said predetermined time, connectionto said master device is electrically released temporarily and then saidconnection is restored.
 30. A program causing a computer to serve, in aslave apparatus according to claim 15 as: judging means of transmittingto said master device a notification code for notifying a presentlyset-up communication mode and then judging whether a command receivedfrom said master device in response to said notification codecorresponds to said presently set-up communication mode or not; andcommunication controlling means of performing control on the basis of ajudgment result of said judging means in such a manner that when saidcommand corresponds to the presently set-up communication mode, a statepermitting communication with said master device is established incorrespondence to the command, and that when said command does notcorrespond to the presently set-up communication mode, connection tosaid master device is electrically released temporarily and then saidconnection is restored.
 31. A program for causing a computer to serve,in a slave apparatus according to claim 16, as: communication modeidentifying means of transmitting to said master device a notificationcode for notifying a presently set-up own communication mode, and thenidentifying the kind of communication mode corresponding to a commandreceived from said master device in response to said notification code;and communication controlling means of performing control such as tochange its own communication mode in correspondence to an identificationresult of said communication mode identifying means and then establish astate permitting communication with said master device.
 32. Acomputer-processable recording medium carrying a program according toany one of claims 29 to
 31. 33. An information processing apparatuscomprising a slave apparatus according to claims 1, 15 or 16, andcapable of communicating with said master device.